//package com.smile.service.impl;
//
//
//import cn.dev33.satoken.stp.StpLogic;
//import cn.dev33.satoken.stp.StpUtil;
//import cn.hutool.core.util.ObjectUtil;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.smile.commons.constant.LoginTypeConstant;
//import com.smile.commons.md5.MD5Util;
//import com.smile.mapper.UserMapper;
//import com.smile.model.domain.SmilePlusUser;
////import com.smile.model.request.AuthLoginRequest;
////import com.smile.model.response.AuthLoginResponse;
//import com.smile.service.AuthService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//@Service
//public class AuthServiceImpl implements AuthService {
//
//    @Autowired
//    private UserMapper userMapper;
//
////    @Override
////    public AuthLoginResponse login(AuthLoginRequest authLoginRequest) {
////        QueryWrapper<SmilePlusUser> queryWrapper = new QueryWrapper<>();
////        queryWrapper.eq("user_name", authLoginRequest.getUserName());
////        SmilePlusUser user = userMapper.selectOne(queryWrapper);
////        if (ObjectUtil.isEmpty(user)) {
////            throw new RuntimeException("用户不存在");
////        }
////
////        String salt = user.getSalt();
////        String s = MD5Util.md5WithSalt(authLoginRequest.getPassword(), salt);
////        if (!user.getPassword().equals(s)) {
////            throw new RuntimeException("用户名或密码错误");
////        }
////
////        StpUtil.login(user.getId(), authLoginRequest.getRememberMe());
////        StpUtil.setStpLogic(new StpLogic(LoginTypeConstant.SYSTEM));
////        AuthLoginResponse authLoginResponse = new AuthLoginResponse();
////        authLoginResponse.setAccess_token("Bearer " + StpUtil.getTokenValue());
////        authLoginResponse.setUserId(authLoginRequest.getUserName());
////        return authLoginResponse;
////    }
//
//    public static void main(String[] args) {
//        System.out.println(MD5Util.md5WithSalt("nice", "nice"));
//    }
//
//}
